From 7984b6bc71576c3224060f1fd376e1da093c9308 Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Fri, 23 Mar 2007 17:51:24 +0000 Subject: [PATCH] Workaround buggy GCCs wrt strftime. Signed-off-by: Ewan Mellor --- tools/libxen/test/test_bindings.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/libxen/test/test_bindings.c b/tools/libxen/test/test_bindings.c index c709e64867..922518fe8a 100644 --- a/tools/libxen/test/test_bindings.c +++ b/tools/libxen/test/test_bindings.c @@ -572,6 +572,16 @@ static void print_vm_power_state(xen_session *session, xen_vm vm) } +/** + * Workaround for whinging GCCs, as suggested by strftime(3). + */ +static size_t my_strftime(char *s, size_t max, const char *fmt, + const struct tm *tm) +{ + return strftime(s, max, fmt, tm); +} + + /** * Print the metrics for the given VM. */ @@ -594,7 +604,7 @@ static void print_vm_metrics(xen_session *session, xen_vm vm) char time[256]; struct tm *tm = localtime(&vm_metrics_record->last_updated); - strftime(time, 256, "Metrics updated at %c, local time.\n", tm); + my_strftime(time, 256, "Metrics updated at %c, local time.\n", tm); printf(time); for (size_t i = 0; i < vm_metrics_record->vcpus_utilisation->size; i++) -- 2.30.2